namespace Se.Framework.Logging
{
    public static class Logger
    {
        private static readonly object oSync = new object();
        private static ISourceableLogger currentLog;

        public static void SetSourceableLogger(ISourceableLogger logger)
        {
            lock (oSync)
            {
                currentLog = logger;
            }
        }

        public static ISourceableLogger Current
        {
            get
            {
                if (currentLog == null)
                {
                    lock (oSync)
                    {
                        if (currentLog == null)
                            currentLog = new Log4NetLogger();
                    }
                }
                return currentLog;
            }
        }
    }
}